#ifndef GGRAPHTABLE_H
#define GGRAPHTABLE_H

#include <QWidget>
#include <QtGui>
#include "gnode.h"
#include "graph.h"
#include "queue.h"


class GGraphTable : public QWidget
{
    Q_OBJECT
    Graph graph;

    void initNodesPos(double spring = 1, double damping = 0.5, double charge = 1);

    QPointF Coulomb_Law(const GNode& a, const GNode& b) const;
    QPointF Hooke_Law(const QPointF &a, const double& spring) const;

    QPoint translateVector;
    bool showTree;

public:
    QVector<GNode*> nodes;
    explicit GGraphTable(QWidget *parent = 0);
    void setGraph(const Graph& g);
    const Graph& getGraph() const;
    void paintEvent(QPaintEvent *e);
    void mouseMoveEvent(QMouseEvent *e);
    void resetGraph();


signals:

public slots:
    void setShowTree(const bool& value);
};

#endif // GGRAPHTABLE_H
